package com.example.demo.api.controller;

import com.example.demo.entity.Job;
import com.example.demo.service.JobService;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author honeypeach
 * @date 2023/3/24 19:20
 */
@RestController
@RequestMapping("/job")
public class JobController {
    private JobService jobService;

    public JobController(JobService jobService) {
        this.jobService = jobService;
    }

    @GetMapping("/get")
    public ResponseEntity<?> get(@RequestParam("jobId") String jobId){
        Job job = jobService.findById(jobId);
        return ResponseEntity.ok(job);
    }
}
